﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using SpecF.ExpressionVisitors;

namespace SpecF.Extensions
{
    public static class ExpressionExtensions
    {
        internal  static List<string> GetExprerssionInformation<T>(this Expression<Func<T, bool>> expression)
        {
            List<string> result = new List<string>();

            if (expression.Body.NodeType == ExpressionType.Call)
            {
                var info = (MethodCallExpression)expression.Body;
                result.Add(info.Method.Name);
            }
            if (expression.Body.NodeType == ExpressionType.AndAlso)
            {
                ExpressionParser parser = new ExpressionParser();
                var properties = parser.Parse((Expression)expression);
            }

            return result;
        }
    }
}
